import os
 
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import IncludeLaunchDescription
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
 
 
def generate_launch_description():
 
    #reading_imu
    reading_imu = Node(
        package='cranebot',
        executable='reading_imu',
    )

    #reading_tof
    reading_move = Node(
        package='cranebot',
        executable='reading_move',
    )    
    #ecab_transform
    cab_transform = Node(
        package='cranebot',
        executable='cab_transform',
        output='screen',
    )

    #relay_control
    relay_control = Node(
        package='cranebot',
        executable='relay_control',
        output='screen',
    )

    #rivz2
    rviz2 = Node(
        package='rviz2',
        executable='rviz2',
        name='rviz2',
    )

    #joint_server
    joint_server = Node(
        package='cranebot',
        executable='joint_server',
        output='screen'
    )

    return LaunchDescription([
    reading_imu,
    reading_move,
    cab_transform,
    relay_control,
    rviz2,
    joint_server,
])
